package com.omar.labs.tamtamy.XML;

import com.omar.labs.tamtamy.User;
import com.omar.labs.tamtamy.utils.XMLUtility;

public class XMLUser extends User{
	
	public XMLUser(String xml) {		
		this.userID = XMLUtility.getNodeValue(xml, "userID");
		this.nickname = XMLUtility.getNodeValue(xml, "nickname");
		this.firstName = XMLUtility.getNodeValue(xml, "firstName");
		this.lastName = XMLUtility.getNodeValue(xml, "lastName");
		this.birthday = XMLUtility.getNodeValueWithAttribute(xml, "birthday", "class=\"sql-timestamp\"");
		this.gender = XMLUtility.getNodeValue(xml, "gender");		
		this.mail = XMLUtility.getNodeValue(xml, "mail");
		this.blog = XMLUtility.getNodeValue(xml, "blog");
		this.interest = XMLUtility.getNodeValue(xml, "interest");
		this.avatarFilename = XMLUtility.getNodeValue(xml, "avatarFilename");
		this.online = Boolean.parseBoolean(XMLUtility.getNodeValue(xml, "onLine"));
	}


}
